<template>
	<h3>Demo1</h3>
	{{ $store.state.count }}
	<button @click="add">add</button>
	<hr />
	{{ count }}
</template>

<script>
	export default {
		created() {
			console.log("count=", this.$store.state.count);
		},
		methods: {
			add() {
				this.$store.commit("increment");
				console.log(this.$store.state.count);
			},
		},
		computed: {
			count() {
				return this.$store.state.count;
			},
		},
	};
</script>
